package jsu.xxy.coffee3.controller;

import com.baomidou.mybatisplus.generator.util.FileUtils;
import io.swagger.v3.oas.annotations.Operation;
import jsu.xxy.coffee3.domain.Orderform;
import jsu.xxy.coffee3.domain.picture;
import jsu.xxy.coffee3.mapper.OrderformMapper;
import jsu.xxy.coffee3.service.impl.OrderformServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.UUID;

@RestController
@CrossOrigin
@RequestMapping("picture")
public class PictureController {
    @Autowired
    OrderformServiceImpl orderformService;
    @GetMapping("/getYear")
    @Operation(summary = "获得每月每年销售")
    public List<picture> getSum(){
        return orderformService.getSum();
    }
    @PostMapping("/upload")
    @Operation(summary = "图片上传")
    public String upload(@RequestParam("file") MultipartFile file) throws IOException {
        return orderformService.upload(file);
    }
}
